package org.umss.fixturebuilder.model.appengine;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.annotation.Parent;
import com.googlecode.objectify.annotation.Unindex;

/**
 *
 * @author Daniela Meneses
 */
@Entity
public class GameModel {

    @Id
    private Long id;
    @Parent
    private Key<RoundModel> round;
    @Index
    private Key<TeamModel> local;
    @Index
    private Key<TeamModel> visitor;
    @Index
    boolean terminated;
    @Unindex
    private int localScore;
    @Unindex
    private int visitorScore;
    

    public GameModel() {
    }

    public GameModel(Key<RoundModel> round) {
        this.round = round;
    }
    
    public GameModel(Key<RoundModel> round, Key<TeamModel> local, Key<TeamModel> visitor) {
        this.round = round;
        this.local = local;
        this.visitor = visitor;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Key<RoundModel> getRound() {
        return round;
    }

    public void setRound(Key<RoundModel> round) {
        this.round = round;
    }

    public Key<TeamModel> getLocal() {
        return local;
    }

    public void setLocal(Key<TeamModel> local) {
        this.local = local;
    }

    public Key<TeamModel> getVisitor() {
        return visitor;
    }

    public void setVisitor(Key<TeamModel> visitor) {
        this.visitor = visitor;
    }

    public boolean isTerminated() {
        return terminated;
    }

    public void setTerminated(boolean terminated) {
        this.terminated = terminated;
    }

    public int getLocalScore() {
        return localScore;
    }

    public void setLocalScore(int localScore) {
        this.localScore = localScore;
    }

    public int getVisitorScore() {
        return visitorScore;
    }

    public void setVisitorScore(int visitorScore) {
        this.visitorScore = visitorScore;
    }

    @Override
    public String toString() {
        return "GameModel{" + "id=" + id + ", round=" + round + ", local=" + local + ", visitor=" + visitor + '}';
    }
}
